Skip to content

Update Gradle Wrapper from 8.14.3 to 9.4.1 & also run tests with JDK 25#1550

Open
hankem wants to merge 4 commits intomainfrom
gradle-9
Open

Update Gradle Wrapper from 8.14.3 to 9.4.1 & also run tests with JDK 25#1550
hankem wants to merge 4 commits intomainfrom
gradle-9

Conversation

@hankem
Copy link
Copy Markdown
Member

@hankem hankem commented Nov 10, 2025

@hankem hankem changed the title Update Gradle Wrapper from 8.14.3 to 9.2 Update Gradle Wrapper from 8.14.3 to 9.2.0 Nov 10, 2025
@hankem hankem changed the title Update Gradle Wrapper from 8.14.3 to 9.2.0 Update Gradle Wrapper from 8.14.3 to 9.2.0 & also run tests with JDK 25 Nov 11, 2025
@hankem hankem requested a review from codecholeric November 11, 2025 07:26
@stefan-heilig-mw
Copy link
Copy Markdown

stefan-heilig-mw commented Nov 26, 2025

Hey @hankem & @codecholeric,

Thank you very much for this adaptation. Can you estimate when this PR will be reviewed?

@hankem
Copy link
Copy Markdown
Member Author

hankem commented Jan 27, 2026

I'm sorry @stefan-heilig-mw; I missed your message! 🙈

Just FYI: I think that the changes only affect the build internally; ArchUnit 1.4.1 already supports JDK 25 (#1440).

@stefan-heilig-mw
Copy link
Copy Markdown

Thank you for your reply. We have managed to get it working since then. There was an error in our setup, which initially pointed to ArchUnit.

@hankem hankem changed the title Update Gradle Wrapper from 8.14.3 to 9.2.0 & also run tests with JDK 25 Update Gradle Wrapper from 8.14.3 to 9.3.1 & also run tests with JDK 25 Feb 11, 2026
hankem added 4 commits April 18, 2026 22:58
as JDK 25 will add a call to `java.util.Objects.requireNonNull`
in the constructor of inner classes,
cf. https://inside.java/2025/04/04/quality-heads-up/
and https://bugs.openjdk.org/browse/JDK-8351274 .

Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
@hankem hankem changed the title Update Gradle Wrapper from 8.14.3 to 9.3.1 & also run tests with JDK 25 Update Gradle Wrapper from 8.14.3 to 9.4.1 & also run tests with JDK 25 Apr 18, 2026
new ClassFileImporter().importClasses(Parent.class, Child.class)
.get(Child.class)
.getMethodCallsFromSelf());
.getMethodCallsFromSelf()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a really long time reproduce the second method call locally, as the build always falls back to java8 as the minimum supported version.
The easiest was in the end to set testJavaVersion=25 manually in the gradle.properties.
Is it document somewhere how to choose the java version for local execution?

public void imports_parameter_types_of_generic_call_target_as_raw_types() {
// We cannot determine generic types of a call target from the bytecode, so the only options are to resolve the target
// and check for generic types or to treat call target parameters always as raw, same as they are in the bytecode.
// For now I have decided for the the latter.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very optional: remove duplicated "the"

.get(Origin.class)
.getMethodCallsFromSelf());
JavaMethodCall call = getOnlyElement(
new ClassFileImporter().importClasses(Origin.class, Target.class)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: keep line breaks as before
same for other tests

.getMethodCallsFromSelf());
.getMethodCallsFromSelf()
.stream()
.filter(call -> call.getOrigin().isMethod())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this relies entirely on the fact the the new null check is added in the constructor which doesn't count as method.
I think this would be easier to understand if you write the filter in a way that makes clear that the target Objects.requireNonNull is excluded and adding a small comment that this is added in java 25+
both the bridge method and the new null check added in byte code where new to me.

As a user of ArchUnit I would be very surprised to see the new synthetic method call to Objects.requireNonNull.
Is that an expected migration effort for Java25 or do we need a special handling for this call (e.g. ignoring it)?

.importClass(Origin.class)
.getMethodCallsFromSelf()
.stream()
.filter(c -> c.getOrigin().isMethod())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are not extremly aware of the new null check, the logic behind this is quite surprising.
Could we filter for origin Origin.resolvesMethodCallTargetOwner instead? it would at least be clear that exactly that one method call in it is meant

or functionally equivalent: again use .getMethod("resolvesMethodCallTargetOwner").getMethodCallsFromSelf() as in other tests

.get(Caller.class)
.getMethodCallsFromSelf()
.stream()
.filter(call -> call.getOrigin().isMethod())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call.getOrigin().getName().matches("call\\d")?
you filter for the name afterwards anyway and this would free us from isMethod (meant as isNotConstructor) which seems a pretty random check to me, if I wouldn't have read the commit message

@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you drop the checksum intentionally?
according to https://gradle.org/release-checksums/ it is now for binary version 9.4.1 2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
and for the wrapper 55243ef57851f12b070ad14f7f5bb8302daceeebc5bce5ece5fa6edb23e1145c (I verified that your new wrapper file has the correct checksum)

If we actually check it somewhere in the pipeline, I'd prefer to keep it, otherwise, deletion is fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants